# /etc/profile

# System wide environment and startup programs, for login setup
# Functions and aliases go in /etc/bashrc

# It's NOT a good idea to change this file unless you know what you
# are doing. It's much better to create a custom.sh shell script in
# /etc/profile.d/ to make custom changes to your environment, as this
# will prevent the need for merging in future updates.

pathmunge () {
    case ":${PATH}:" in
        *:"$1":*)
            ;;
        *)
            if [ "$2" = "after" ] ; then
                PATH=$PATH:$1
            else
                PATH=$1:$PATH
            fi
    esac
}


if [ -x /usr/bin/id ]; then
    if [ -z "$EUID" ]; then
        # ksh workaround
        EUID=`/usr/bin/id -u`
        UID=`/usr/bin/id -ru`
    fi
    USER="`/usr/bin/id -un`"
    LOGNAME=$USER
    MAIL="/var/spool/mail/$USER"
fi

# Path manipulation
if [ "$EUID" = "0" ]; then
    pathmunge /sbin
    pathmunge /usr/sbin
    pathmunge /usr/local/sbin
else
    pathmunge /usr/local/sbin after
    pathmunge /usr/sbin after
    pathmunge /sbin after
fi

HOSTNAME=`/bin/hostname 2>/dev/null`
HISTSIZE=1000
if [ "$HISTCONTROL" = "ignorespace" ] ; then
    export HISTCONTROL=ignoreboth
else
    export HISTCONTROL=ignoredups
fi

export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL

# By default, we want umask to get set. This sets it for login shell
# Current threshold for system reserved uid/gids is 200
# You could check uidgid reservation validity in
# /usr/share/doc/setup-*/uidgid file
if [ $UID -gt 199 ] && [ "`/usr/bin/id -gn`" = "`/usr/bin/id -un`" ]; then
    umask 002
else
    umask 022
fi

for i in /etc/profile.d/*.sh ; do
    if [ -r "$i" ]; then
        if [ "${-#*i}" != "$-" ]; then
            . "$i"
        else
            . "$i" >/dev/null 2>&1
        fi
    fi
done

unset i
unset -f pathmunge

export RZSZ_HOME=/export/servers/lrzsz-0.12.20
export PATH=$RZSZ_HOME/bin:$PATH

export JAVA_HOME=/export/servers/jdk1.8.0_141
export PATH=$JAVA_HOME/bin:$PATH

export ZK_HOME=/export/servers/zookeeper-3.4.5-cdh5.14.0
export PATH=$ZK_HOME/bin:$PATH

export HADOOP_HOME=/export/servers/hadoop-2.6.0-cdh5.14.0
export PATH=$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$PATH
export HADOOP_CONF_DIR=/export/servers/hadoop-2.6.0-cdh5.14.0/etc/hadoop

export OOZIE_HOME=/export/servers/oozie-4.1.0-cdh5.14.0
export OOZIE_URL=http://node03:11000/oozie
export PATH=:$OOZIE_HOME/bin:$PATH

export SQOOP_HOME=/export/servers/sqoop-1.4.6-cdh5.14.0
export PATH=$SQOOP_HOME/bin:$PATH

export SPARK_HOME=/export/servers/spark-2.2.0-bin-hadoop2.6
export PATH=$SPARK_HOME/bin:$SPARK_HOME/sbin:$PATH

export HIVE_HOME=/export/servers/apache-hive-2.1.1-bin
export PATH=$HIVE_HOME/bin:$PATH

export KAFKA_HOME=/export/servers/kafka_2.11-1.0.0
#export KAFKA_HOME=/export/servers/kafka_2.11-0.10.1.0
export PATH=$KAFKA_HOME/bin:$PATH

export FLUME_HOME=/export/servers/apache-flume-1.6.0-cdh5.14.0-bin
export PATH=$FLUME_HOME/bin:$PATH

export KE_HOME=/export/servers/kafka-eagle-web-1.3.2
export PATH=$KE_HOME/bin:$PATH

export ONEKEY_HOME=/export/servers/onekey
export PATH=$ONEKEY_HOME/kafka:$PATH
export PATH=$ONEKEY_HOME/hive:$PATH
export PATH=$ONEKEY_HOME/hue:$PATH
export PATH=$ONEKEY_HOME/impala:$PATH
export PATH=$ONEKEY_HOME/azkaban:$PATH 
export PATH=$ONEKEY_HOME/druid:$PATH 
export PATH=$ONEKEY_HOME/flume:$PATH 
export PATH=$ONEKEY_HOME/kudu:$PATH 

export STORM_HOME=/export/servers/apache-storm-1.1.1
export PATH=$STORM_HOME/bin:$PATH

export HBASE_HOME=/export/servers/hbase-1.1.1
export PATH=$HBASE_HOME/bin:$PATH

export KYLIN_HOME=/export/servers/apache-kylin-2.6.3-bin-hbase1x
export PATH=$KYLIN_HOME/bin:$PATH

export PHOENIX_HOME=/export/servers/apache-phoenix-4.14.0-HBase-1.1-bin
#export PHOENIX_HOME=/export/servers/apache-phoenix-5.0.0-HBase-2.0-bin 
export PATH=$PHOENIX_HOME/bin:$PATH

# KETTLE
export KETTLE=/export/servers/data-integration
export PATH=${KETTLE}:$PATH

export ZEPPELIN_HOME=/export/servers/zeppelin-0.8.0-bin-all
export PATH=$ZEPPELIN_HOME/bin:$PATH


# DRUID
export DRUID_HOME=/export/servers/imply-3.0.4
export PATH=$DRUID_HOME/bin:$PATH

#superset Anaconda 
#export PATH=$PATH:/export/servers/anaconda3/bin
